home *** CD-ROM | disk | FTP | other *** search
- ; EMACS.RC: Standard micro Startup program
- ; for MicroEMACS 3.9d and above
- ; (C)opyright 1987 by Daniel M Lawrence
- ; Last Update: 10/20/87
-
- set $discmd FALSE
- write-message "[Setting up....]"
-
- ; If you screen "SNOWS", comment this line
- set $flicker "FALSE"
-
- ; To use an IBM-PC EGA card, uncomment the following line
- ; set $sres "EGA"
-
- ; Set Default Global modes
-
- add-global-mode "white"
- add-global-mode "BLACK"
-
- ; Time how long a matching fence is displayed. As it is machine-dependant,
- ; on a TT you might want to increase this value...
- set $tpause 300
-
- set $timeflag TRUE
- ;bind-to-key meta-prefix ` ;for annoying keyboards with ` at the top left
-
- ; Toggle function key window display
-
- ; Uncomment the following if you have a mv program and you want
- ; backups of your files to be placed in $TMPDIR
-
- store-procedure filebackup
- !if &exist $cfname
- execute-program &cat &cat &cat "mv " $cfname " " &env TMPDIR
- !endif
- !endm
- set $writehook filebackup
-
- store-procedure toggle-fkeys
- !if %rcfkeys
- !goto rcfoff
- !endif
-
- ; toggle function key window on
- save-window
- 1 next-window
- !if &sequal $cbufname "emacs.hlp"
- delete-window
- !endif
- !if ¬ &sequal $cbufname "Function Keys"
- 1 split-current-window
- 1 select-buffer "Function Keys"
- add-mode "red"
- add-mode "YELLOW"
- !force 5 resize-window
- 1 goto-line
- !endif
- set %rcfkeys TRUE
- !force restore-window
- !if &sequal $cbufname "Function Keys"
- next-window
- !endif
- write-message "[Function key window ON]"
- !return
-
- ;Toggle the function key window off
- *rcfoff
- save-window
- 1 next-window
- !if &sequal "Function Keys" $cbufname
- delete-window
- !endif
- !force restore-window
- write-message "[Function key window OFF]"
- set %rcfkeys FALSE
- !endm
-
- ; Bring up Online-help system
-
- store-procedure get-help
- set $discmd FALSE
- source ehelp.cmd
- set $discmd TRUE
- !endm
-
- ; Load a new page
-
- store-procedure get-page-loader
- !if &seq &find newpage.cmd ""
- write-message "[Can not find NEWPAGE.CMD]"
- !return
- !endif
- !force execute-file newpage.cmd
- !endm
-
- ;procedure to clean out the current page (which is nothing right now)
-
- store-procedure clean
- ; nothing by default
- !endm
-
- ; Set up auto CMODE
-
- store-procedure set-default-mode
- set %rcstmp &right $cfname 4
- set %rctmp &sin %rcstmp "."
- !if &equ %rctmp 0
- !return
- !endif
- set %rctmp &mid %rcstmp &add %rctmp 1 5
- !if &or &seq &upp %rctmp "C" &seq &upp %rctmp "H"
- add-mode "cmode"
- !endif
- !if &seq &upp %rctmp "CC"
- add-mode "cmode"
- !endif
- !if &or &seq &upp %rctmp "CPP" &seq &upp %rctmp "HPP"
- add-mode "cmode"
- !endif
- !if &or &seq &upp %rctmp "MSS" &seq &upp %rctmp "TEX"
- add-mode "wrap"
- !endif
- !endm
- set $readhook set-default-mode
-
- ; This function activates the function key window as
- ; a legitimate place to call up function keys using the mouse
-
- store-procedure mouse-clicks
-
- ;remember where we started, and do the mouse movement
- save-window
- !force mouse-move-down
-
- ;If not in the function key window... leave
- !if ¬ &sequal $cbufname "Function Keys"
- !return
- !endif
-
- ;First pos is a screen reposition, let it through
- !if &and &equ $xpos 0 &equ $ypos 0
- restore-window
- !return
- !endif
-
- ;Find out what function key were gonna do
- add-mode magic
- 2 forward-character
- set %rctmp $search
- !force search-reverse "[fF][0-9]"
- !if &seq $status FALSE
- delete-mode magic
- set $search %rctmp
- !return
- !endif
-
- ;we are on the "f" or "F". Get the function key type and number now
- set $search %rctmp
- set %fcase lower
- !if &equ $curchar 70
- set %fcase upper
- !endif
- 1 forward-character
- set %fnum &chr $curchar
- 1 forward-character
- set %fnum &cat %fnum &chr $curchar
- set %fnum &add %fnum 0
- !if &equ %fnum 10
- set %fnum "0"
- !endif
- set %fname &cat "FN" %fnum
- !if &seq %fcase upper
- set %fname &cat "S-" %fname
- !endif
-
- ;save the function
- set %rccmd &bind %fname
- delete-mode MAGIC
-
- ;swallow the up-button
- set %rctmp >c
-
- ;restore the window and exit
- restore-window
-
- ;procedures don't need the square brackets
- !if &seq &left %rccmd 1 "["
- set %rccmd &mid %rccmd 2 &sub &len %rccmd 2
- %rccmd
- !return
- !endif
-
- ;and then execute it
- !force execute-named-command %rccmd
- !endm
- macro-to-key mouse-clicks MSa
-
- ; This is just a simple macro for sending mails. You need a sendmail
- ; and you have to set its options right in mail.
- store-procedure mail
- execute-file d:\lib\me3.11\cmd\mail
- !endm
- macro-to-key mail M-S
-
- ; ***** Rebind the Function key group
-
- bind-to-key search-forward FN1
- bind-to-key search-reverse FN2
- bind-to-key hunt-forward FN3
- bind-to-key hunt-backward FN4
- macro-to-key toggle-fkeys FN5
- macro-to-key get-help FN6
- bind-to-key next-window FN7
- macro-to-key get-page-loader FN8
- bind-to-key save-file FN9
- bind-to-key exit-emacs FN0
-
- bind-to-key execute-macro-10 S-FN1
- bind-to-key execute-macro-11 S-FN2
- bind-to-key execute-macro-12 S-FN3
- bind-to-key execute-macro-13 S-FN4
- bind-to-key execute-macro-14 S-FN5
- bind-to-key execute-macro-15 S-FN6
- bind-to-key execute-macro-16 S-FN7
- bind-to-key execute-macro-17 S-FN8
- bind-to-key execute-macro-18 S-FN9
- bind-to-key execute-macro-19 S-FN0
-
- ; bring up the function key window
-
- 1 split-current-window
- select-buffer "Function Keys"
- set $cbflags 1
- insert-string "f1 search-> f2 <-search ף MicroEMACS: Text Editor~n"
- insert-string "f3 hunt-> f4 <-hunt ף ~n"
- set %rctmp &sin $osystem "/"
- !if &equ %rctmp 0
- !goto nofsel
- !endif
- set %rctmp &mid $osystem %rctmp 6
- !if &or &seq %rctmp "/ AES " &seq %rctmp "/ ST52"
-
- store-procedure toggle-fsel
- set $gflags &bxor $gflags 4
- !if &equ &band $gflags 4 4
- print "Fileselector turned ON."
- !else
- print "Fileselector turned OFF."
- !endif
- !endm
-
- insert-string "f5 fkeys f6 filesel. ף Available function key Pages include:~n"
- macro-to-key toggle-fsel FN6
- !else
- *nofsel
- insert-string "f5 fkeys f6 help ף Available function key Pages include:~n"
- !endif
- insert-string "f7 nxt wind f8 pg[ ] ף Word Box Emacs Pascal C cObal Lisp~n"
- insert-string "f9 save f10 exit ף [use the f8 key to load Pages]~n"
- unmark-buffer
- delete-window
- set %rcfkeys FALSE
-
- ; Bind keypad, help and delete keys on ST
- !force execute-file stkeypad.cmd
- !force execute-file &cat &cat &env HOME "\" "emacs.hrc"
- set $discmd TRUE
-